from django.db import models
 
class Test(models.Model):
    name = models.CharField(max_length=20)

class Record(models.Model):
    id = models.BigAutoField(primary_key=True)
    uip = models.CharField(max_length=128)
    sip = models.CharField(max_length=128, default="")
    uid = models.CharField(max_length=64, default=0)
    host = models.CharField(max_length=50, default="")
    target= models.CharField(max_length=50, default="")
    page = models.CharField(max_length=128, default="")
    pos = models.CharField(max_length=50, default="")
    url = models.CharField(max_length=256)
    evname = models.CharField(max_length=30)
    time = models.DateTimeField(auto_now_add=True) 
    content = models.TextField(default='') 
    ua = models.TextField(default="")
    clt = models.CharField(max_length=50, default="")


class check_site_logs(models.Model):
    id = models.BigAutoField(primary_key=True)
    create_time = models.DateTimeField(auto_now_add=True)
    # 耗时
    consuming = models.IntegerField(default=0)
    domains = models.TextField(default='')
    suc = models.IntegerField(default=0)
    fail = models.IntegerField(default=0)
    fail_asses = models.TextField(default='') 
    fail_other = models.TextField(default='') 
    snapshot = models.CharField(max_length=256)
    details = models.TextField(default='')

class DlzUserInfo(models.Model):
    id = models.BigAutoField(primary_key=True)
    site = models.CharField(max_length=255)
    uid = models.CharField(unique=True, max_length=255)
    create_time = models.DateTimeField(auto_now_add=True)